<?php
/**
 * Created by PhpStorm.
 * User: liu
 * Date: 2018/6/7
 * Time: 23:46
 */

namespace app\admin\controller;


use app\common\traits\CURD;
use think\Controller;
use think\Model;

/**
 * Class Base
 * @package app\admin\controller
 * @property Model $model
 */
class Base extends Controller
{
    protected $search_fields=null;
    protected $relation_search=null;
    use CURD;

    protected $model;


    public function initialize()
    {
        //转化大小写,防止多级控制器被转化成 _controller
        $c=$this->request->controller();
        $c=preg_replace_callback('/\.(\w)/',function($matches){
            return '.'.strtolower($matches[1]);
        },$c);
        $this->request->setController($c);
    }
}